//
//  BSStatusBottomView.swift
//  mySwiftWeibo
//
//  Created by apple on 16/7/31.
//  Copyright © 2016年 itcast沈庆伟. All rights reserved.
//

import UIKit

///底部view,包含3按钮
class BSStatusBottomView: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
  
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    //UI
    private func setupUI(){
        //添加
        self.addSubview(retweetButton)
        self.addSubview(commentButton)
        self.addSubview(likeButton)
        self.addSubview(separatorViewFirst)
        self.addSubview(separatorViewSecond)
        
        //约束
        retweetButton.snp_makeConstraints { (make) -> Void in
            make.leading.top.bottom.equalTo(self)
        }
        
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(retweetButton.snp_trailing)
            make.top.bottom.equalTo(self)
            make.width.equalTo(retweetButton)
        }
        
        likeButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(commentButton.snp_trailing)
            make.top.trailing.bottom.equalTo(self)
            make.width.equalTo(commentButton)
        }
        
        separatorViewFirst.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(retweetButton.snp_trailing)
            make.centerY.equalTo(retweetButton)
        }
        
        separatorViewSecond.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentButton.snp_trailing)
            make.centerY.equalTo(commentButton)
        }
    }
    
    //MARK: - lanjiazai
    private lazy var retweetButton: UIButton=UIButton(imageName: "timeline_icon_retweet", title: "转发")
    
    private lazy var commentButton: UIButton=UIButton(imageName: "timeline_icon_comment", title: "评论")
    
    private lazy var likeButton: UIButton=UIButton(imageName: "timeline_icon_unlike", title: "赞")
    
    ///竖线
    private lazy var separatorViewFirst: UIImageView=UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    private lazy var separatorViewSecond: UIImageView=UIImageView(image: UIImage(named: "timeline_card_bottom_line"))

}
